<template>
  <div>child子组件</div>
  <p>cityname: {{ cityname }}</p>
  <p>doublename: {{ doublename }}</p>
  <button @click="fn">btn</button>
</template>

<script setup lang="ts">
import { computed } from "vue";
import { useCityStore } from "./stores/city";

const store = useCityStore();
const cityname = computed(() => store.cityname);
const doublename = computed(() => store.doublename);

const fn = () => {
  // store.cityname = "上海";

  // store.$patch({
  //   cityname: "杭州",
  // });

  store.changecity();
};
</script>
